<template>
  <div>
    <p>AAAA</p>
    <button @click="handleClick">按钮</button>
  </div>
</template>

<script>
export default {
  name: "AComp",
  methods: {
    handleClick() {
      // 触发自定义事件
      this.$emit("setNum", 2);
    },
  },
};
</script>

<style></style>
